<!--
 * @Author: qiaoxin
 * @Date: 2024-04-09 19:35:26
 * @LastEditors: qiaoxin
 * @LastEditTime: 2024-04-16 12:03:50
 * @Description: 
 * @FilePath: \erp-app\src\pages\pm\requirement\detail.vue
-->

<route lang="json5">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '研发任务单',
    enablePullDownRefresh: false,
    navigationStyle: 'custom',
  },
}
</route>

<template>
  <page-meta :root-font-size="setting.rootFontSize"></page-meta>
  <view style="display: flex; flex-direction: column; height: 100vh; background-color: #f2f2f1">
    <view style="position: sticky; top: 0; z-index: 9999">
      <wd-navbar title="研发任务单" :bordered="false" safeAreaInsetTop>
        <template #left>
          <wd-icon name="thin-arrow-left" size="22px" color="white" @click="goBack"></wd-icon>
        </template>
      </wd-navbar>
    </view>
    <view style="flex: 1; overflow: auto">
      <th-card title="需求单信息">
        <th-form>
          <th-form-item label="需求产品">
            <text class="text">{{ form.invName }}</text>
          </th-form-item>
          <th-form-item label="需求产品规格">
            <text class="text">{{ form.invStd }}</text>
          </th-form-item>
          <th-form-item label="用途">
            <text class="text">{{ form.applicationType }}</text>
          </th-form-item>
          <th-form-item label="要求完成时间">
            <text class="text">{{ form.askCompleteTime }}</text>
          </th-form-item>

          <template v-if="showMoreDemand">
            <th-form-item label="需求单编号">
              <text class="text">{{ form.demandCode }}</text>
            </th-form-item>
            <th-form-item label="需求单日期">
              <text class="text">{{ formatByDayjs(form.demandDate) }}</text>
            </th-form-item>
            <th-form-item label="客户" v-if="form.cusCode">
              <text class="text">{{ form.cusCode }}</text>
            </th-form-item>

            <th-form-item label="业务员">
              <text class="text">{{ form.personName }}</text>
            </th-form-item>
            <th-form-item label="业务部门" v-if="form.deptName">
              <text class="text">{{ form.deptName }}</text>
            </th-form-item>
            <th-form-item label="所属公司" v-if="form.tenantName">
              <text class="text">{{ form.tenantName }}</text>
            </th-form-item>

            <th-form-item label="需求类型">
              <text class="text">{{ form.demandType }}</text>
            </th-form-item>

            <th-form-item label="年需求量/吨">
              <text class="text">{{ form.invDemand }}</text>
            </th-form-item>

            <th-form-item label="是否有外来样">
              <text class="text">{{ form.sampleFlagName }}</text>
            </th-form-item>
            <th-form-item label="外来样样品编码" v-show="form.sampleFlag != '0'">
              <text class="text">{{ form.sampleCode }}</text>
            </th-form-item>
            <th-form-item label="外来样样品数量" v-show="form.sampleFlag != '0'">
              <text class="text">{{ form.samplesNum }}{{ form.sampleUnit }}</text>
            </th-form-item>
            <th-form-item label="外来样批次" v-show="form.sampleFlag != '0'">
              <text class="text">{{ form.sampleBatch }}</text>
            </th-form-item>
            <th-form-item label="是否给客户提供样品">
              <text class="text">{{ form.requestFlag == '1' ? '是' : '否' }}</text>
            </th-form-item>
            <th-form-item label="给客户提供样品数量" v-if="form.requestFlag == '1'">
              <text class="text">{{ form.requestNum }}{{ form.requestNumUnit }}</text>
            </th-form-item>

            <th-form-item
              label="需求指标"
              labelPosition="top"
              v-show="checkTargetList && checkTargetList.length"
            >
              <view style="overflow: auto" class="table-container">
                <table class="analysis-table">
                  <tbody>
                    <tr>
                      <th style="width: 320rpx; min-width: 9.5rem">检验指标名称</th>
                      <th
                        style="width: 280rpx; min-width: 280rpx"
                        v-if="form.demandTypeCode != '42'"
                      >
                        U8指标
                      </th>
                      <th style="width: 280rpx; min-width: 280rpx">客户指标</th>
                      <th style="width: 280rpx; min-width: 280rpx">描述</th>
                    </tr>
                    <tr
                      align="center"
                      v-for="(item, index) in checkTargetList"
                      :key="index"
                      :class="[item.checktarget != item.cusCheckTarget ? 'line-red' : '']"
                    >
                      <td>
                        {{ item.standardName }}
                      </td>
                      <td v-if="form.demandTypeCode != '42'">
                        {{ item.standardValue }}
                      </td>
                      <td>
                        {{ item.standardValuePm }}
                      </td>
                      <td>
                        {{ item.standardDesc }}
                      </td>
                    </tr>
                  </tbody>
                </table>
              </view>
            </th-form-item>
          </template>
          <th-form-item
            label="附件"
            class="form-demandDesc form-file"
            v-if="form.rdDemandFileEntity && form.rdDemandFileEntity.length"
          >
            <view class="form-file-view">
              <view
                v-for="(file, index) in form.rdDemandFileEntity"
                :key="file.fileUrl"
                class="info-row-item"
              >
                <text @click="previewFileHandle(file.fileUrl)">{{ file.fileName }}</text>
              </view>
            </view>
          </th-form-item>
          <th-form-item label="需求描述" class="form-demandDesc" v-if="form.demandDesc">
            <text class="text">{{ form.demandDesc }}</text>
          </th-form-item>
          <th-form-item
            label="需求评审结论"
            class="form-demandDesc"
            v-if="form.reviewConclusiondemand"
          >
            <text class="text">{{ form.reviewConclusiondemand }}</text>
          </th-form-item>
          <th-form-item label="需求评审结论描述" class="form-demandDesc" v-if="form.demandResult">
            <text class="text">{{ form.demandResult }}</text>
          </th-form-item>
          <view class="exportModel" @click="showMoreDemandhandle">
            <text>{{ showMoreDemand ? '收起' : '展开' }}</text>
          </view>
        </th-form>
      </th-card>
      <!-- <th-card title="任务单信息">
        <th-form-item label="任务编码">
          <text class="text">{{ form.projectCode }}</text>
        </th-form-item>
        <th-form-item label="任务名称">
          <text class="text">{{ form.projectName }}</text>
        </th-form-item>
        <th-form-item label="项目负责人">
          <text class="text">{{ form.projectHeadName }}</text>
        </th-form-item>
        <th-form-item label="预计完成时间">
          <text class="text">{{ formatByDayjs(form.completionTime) }}</text>
        </th-form-item>
        <th-form-item label="技术负责人">
          <text class="text">{{ form.technologyHeadName }}</text>
        </th-form-item>
        <th-form-item label="研发方案" class="form-demandDesc">
          <text class="text">{{ form.rdPlan }}</text>
        </th-form-item>
        <th-form-item label="项目成员">
          <text class="text">{{ form.rdProjectUser }}</text>
        </th-form-item>
        <th-form-item label="签收人">
          <text class="text">{{ form.signedName }}</text>
        </th-form-item>
        <th-form-item
          label="资料收集"
          style="flex-direction: column; align-items: start"
          v-if="form.rdInformationDTO.length"
        >
          <view class="info-list">
            <view v-for="item in form.rdInformationDTO" :key="item.id" class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">资料名称</view>
                <view class="info-list-value">{{ item.informationName }}</view>
              </view>
              <view class="info-list-row">
                <view class="info-list-label">资料描述</view>
                <view class="info-list-value">{{ item.informationDesc }}</view>
              </view>
              <view
                class="info-list-row"
                v-if="item.rdInformationProfileEntity && item.rdInformationProfileEntity.length"
              >
                <view class="info-list-label">附件</view>
                <view class="info-list-value">
                  <view
                    v-for="file in item.rdInformationProfileEntity"
                    :key="file.id"
                    @click="previewFileHandle(file.profileUrl)"
                    class="info-row-item"
                  >
                    {{ file.profileInfo }}
                  </view>
                </view>
              </view>
              <view class="info-list-row">
                <view class="info-list-label">网址</view>
                <view
                  class="info-list-value info-row-item"
                  @click="previewWeb(item.informationWeb)"
                >
                  {{ item.informationWeb }}
                </view>
              </view>
            </view>
          </view>
        </th-form-item>
        <th-form-item
          label="合成工艺路线"
          style="flex-direction: column; align-items: start"
          v-if="form.rdCraftEntity.length"
        >
          <view class="info-list">
            <view v-for="item in form.rdCraftEntity" :key="item.id" class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">名称</view>
                <view class="info-list-value">{{ item.craftName }}</view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">反应条件</view>
                <view class="info-list-value">{{ item.craftDesc }}</view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">路线</view>
                <view class="info-list-value">
                  <wd-img
                    :width="140"
                    :height="140"
                    :src="item.craftUrl"
                    mode="aspectFit"
                    :enable-preview="true"
                  />
                </view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">是否选择</view>
                <view class="info-list-value">
                  <wd-switch
                    disabled
                    v-model="item.isUse"
                    :active-value="1"
                    :inactive-value="0"
                    style="margin: 5rpx 0"
                    size="small"
                  ></wd-switch>
                </view>
              </view>
            </view>
          </view>
        </th-form-item>
        <th-form-item label="样品分析方法" v-if="form.rdSampleAnalysisEntity.length">
          <text class="text">
            <view style="display: flex; flex-wrap: wrap">
              <view
                v-for="item in form.rdSampleAnalysisEntity"
                :key="item.id"
                class="result-tag"
                style="margin-right: 10rpx; background-color: #4d80f0"
              >
                {{ item.analysisName }}
              </view>
            </view>
          </text>
        </th-form-item>
        <th-form-item label="综述" class="form-demandDesc">
          <text class="text">{{ form.sampleReviewConclusion }}</text>
        </th-form-item>
      </th-card> -->

      <th-card
        title="子任务记录"
        v-if="form.rdTaskListAll && form.rdTaskListAll.length && taskTypeList.includes('10')"
      >
        <wd-collapse v-model="rdTaskListAllActiveKey">
          <wd-collapse-item
            v-for="item in form.rdTaskListAll"
            :key="item.id"
            :name="item.id"
            :title="item.title"
            :before-expend="beforeExpend"
            custom-class="custom-class-collapse"
          >
            <view>
              <view v-if="item.taskType == '3'">
                <information :ref="($event) => setItemRef($event, item.taskCode)"></information>
              </view>
              <view v-if="item.taskType == '2' || item.taskType == '12'">
                <sampleAnalysisze
                  :ref="($event) => setItemRef($event, item.taskCode)"
                ></sampleAnalysisze>
              </view>
              <view v-if="item.taskType == '4'">
                <questionForm :ref="($event) => setItemRef($event, item.taskCode)"></questionForm>
              </view>
              <view v-if="item.taskType == '9'">
                <otherForm :ref="($event) => setItemRef($event, item.taskCode)"></otherForm>
              </view>
              <view v-if="item.taskType == '6'">
                <fupeiForm :ref="($event) => setItemRef($event, item.taskCode)"></fupeiForm>
              </view>
              <view v-if="item.taskType == '7'">
                <attenuationForm
                  :ref="($event) => setItemRef($event, item.taskCode)"
                ></attenuationForm>
              </view>
              <view v-if="item.taskType == '30'">
                <directSampleForm
                  :ref="($event) => setItemRef($event, item.taskCode)"
                ></directSampleForm>
              </view>
              <view v-if="item.taskType == '13'">
                <extendenWarrantyPeriodForm
                  :ref="($event) => setItemRef($event, item.taskCode)"
                ></extendenWarrantyPeriodForm>
              </view>
            </view>
          </wd-collapse-item>
        </wd-collapse>
      </th-card>

      <th-card title="任务单信息">
        <!-- <th-form> -->

        <!-- <th-form-item label="任务编码">
          <text class="text">{{ form.projectCode }}</text>
        </th-form-item> -->
        <th-form-item label="任务名称">
          <!-- <text class="text">{{ form.projectName }}</text> -->
          <text class="text">{{ form.invName }}-{{ form.invStd }}-{{ form.projectName }}</text>
        </th-form-item>
        <!-- <th-form-item label="项目负责人">
          <text class="text">{{ form.projectHeadName }}</text>
        </th-form-item> -->
        <th-form-item label="任务预计完成日期" v-if="form.userTime">
          <text class="text">{{ formatByDayjs(form.userTime) }}</text>
          <!-- <text class="text">{{ form.userTime }}</text> -->
        </th-form-item>
        <!-- <th-form-item label="技术负责人">
          <text class="text">{{ form.technologyHeadName }}</text>
        </th-form-item> -->
        <th-form-item label="任务负责人" v-if="form.technologyHeadName">
          <text class="text">{{ form.technologyHeadName }}</text>
        </th-form-item>
        <th-form-item label="任务成员" v-if="form.taskUser">
          <text class="text">{{ form.taskUser }}</text>
        </th-form-item>
        <th-form-item label="任务单编号">
          <text class="text">{{ form.taskCode }}</text>
        </th-form-item>
        <th-form-item label="研发方案" class="form-demandDesc" v-if="form.rdPlan">
          <text class="text">{{ form.rdPlan }}</text>
        </th-form-item>
        <th-form-item label="项目名称" v-if="form.petitionName">
          <text class="text seq-no-text">{{ form.petitionName }}</text>
        </th-form-item>
        <th-form-item
          label="是否推荐现有产品"
          class="form-demandDesc"
          v-if="form.recommendFlag !== null"
        >
          <text class="text">
            {{ form.recommendFlag == 1 ? '是' : form.recommendFlag == 0 ? '否' : '' }}
          </text>
        </th-form-item>
        <th-form-item label="推荐产品名称" class="form-demandDesc" v-if="form.recommendFlag == 1">
          <text class="text">
            {{ form.recommendInvName }}
          </text>
        </th-form-item>
        <th-form-item label="推荐产品规格" class="form-demandDesc" v-if="form.recommendFlag == 1">
          <text class="text">
            {{ form.recommendInvStd }}
          </text>
        </th-form-item>
        <!-- <th-form-item label="项目成员">
          <text class="text">{{ form.rdProjectUser }}</text>
        </th-form-item>
        <th-form-item label="签收人">
          <text class="text">{{ form.signedName }}</text>
        </th-form-item> -->
        <!-- <th-form-item
          v-for="item in rdProjectUserList.filter(
            (item) => item.chooseFlag == 1 && item.documentsPostCode != '0',
          )"
          :label="item.documentsPostName"
          :key="item.id"
        >
          <text class="text">{{ getProjectName(item) }}</text>
        </th-form-item> -->
        <!-- <th-form-item label="项目成员" class="form-demandDesc">
          <text class="text">{{ getProjectName({ documentsPostCode: 0 }) }}</text>
        </th-form-item> -->
        <!-- <th-form-item
          label="资料收集"
          style="flex-direction: column; align-items: start"
          v-if="form.rdInformationDTO.length"
        >
          <view class="info-list">
            <view v-for="item in form.rdInformationDTO" :key="item.id" class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">资料名称</view>
                <view class="info-list-value">{{ item.informationName }}</view>
              </view>
              <view class="info-list-row">
                <view class="info-list-label">资料描述</view>
                <view class="info-list-value">{{ item.informationDesc }}</view>
              </view>
              <view
                class="info-list-row"
                v-if="item.rdInformationProfileEntity && item.rdInformationProfileEntity.length"
              >
                <view class="info-list-label">附件</view>
                <view class="info-list-value">
                  <view style="display: flex; flex-direction: column">
                    <view
                      v-for="file in item.rdInformationProfileEntity"
                      :key="file.id"
                      @click="previewFileHandle(file.profileUrl)"
                      class="info-row-item"
                    >
                      {{ file.profileInfo }}
                    </view>
                  </view>
                </view>
              </view>
              <view class="info-list-row">
                <view class="info-list-label">网址</view>
                <view
                  class="info-list-value info-row-item"
                  @click="previewWeb(item.informationWeb)"
                >
                  {{ item.informationWeb }}
                </view>
              </view>
            </view>
          </view>
        </th-form-item>
        <th-form-item
          label="合成工艺路线"
          style="flex-direction: column; align-items: start"
          v-if="form.rdCraftEntity.length"
        >
          <view class="info-list">
            <view v-for="item in form.rdCraftEntity" :key="item.id" class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">名称</view>
                <view class="info-list-value">{{ item.craftName }}</view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">反应条件</view>
                <view class="info-list-value">{{ item.craftDesc }}</view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">路线</view>
                <view class="info-list-value">
                  <wd-img
                    :width="140"
                    :height="140"
                    :src="item.craftUrl"
                    mode="aspectFit"
                    :enable-preview="true"
                  />
                </view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">是否选择</view>
                <view class="info-list-value">
                  <wd-switch
                    disabled
                    v-model="item.isUse"
                    :active-value="1"
                    :inactive-value="0"
                    style="margin: 5rpx 0"
                    size="small"
                  ></wd-switch>
                </view>
              </view>
            </view>
          </view>
        </th-form-item>
        <th-form-item label="分析手段" v-if="form.rdSampleAnalysisEntity.length">
          <text class="text">
            <view style="display: flex; flex-wrap: wrap">
              <view
                v-for="item in form.rdSampleAnalysisEntity"
                :key="item.id"
                class="result-tag"
                style="margin-right: 10rpx; background-color: #4d80f0"
              >
                {{ item.analysisName }}
              </view>
            </view>
          </text>
        </th-form-item>
        <view
          style="overflow: auto"
          class="table-container"
          v-if="form.rdSampleAnalysisEntity.length"
        >
          <table class="analysis-table">
            <tbody>
              <tr>
                <th style="width: 320rpx; min-width: 9.5rem">名称</th>
                <th style="width: 280rpx; min-width: 280rpx">说明</th>
              </tr>
              <tr align="center" v-for="(item, index) in form.rdSampleAnalysisEntity" :key="index">
                <td>
                  <view>
                    {{ item.analysisName }}
                  </view>
                </td>
                <td>
                  <view>
                    {{ item.analysisDesc }}
                  </view>
                </td>
              </tr>
            </tbody>
          </table>
        </view>

        <th-form-item label="综述" class="form-demandDesc" v-if="form.sampleReviewConclusion">
          <text class="text">{{ form.sampleReviewConclusion }}</text>
        </th-form-item>
        <th-form-item label="其他内容" class="form-demandDesc" v-if="form.others">
          <text class="text">{{ form.others }}</text>
        </th-form-item>
        <th-form-item
          label="调查问卷"
          style="flex-direction: column; align-items: start"
          v-if="form.rdTaskFileEntity.length"
        >
          <view class="info-list">
            <view class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">附件</view>
                <view class="info-list-value">
                  <view style="display: flex; flex-direction: column">
                    <view
                      v-for="file in form.rdTaskFileEntity"
                      :key="file.id"
                      @click="previewFileHandle(file.fileUrl)"
                      class="info-row-item"
                    >
                      {{ file.fileName }}
                    </view>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </th-form-item> -->
        <th-form-item
          label="资料收集"
          style="flex-direction: column; align-items: start"
          v-if="
            form.rdInformationDTO &&
            form.rdInformationDTO.length &&
            (taskTypeList.includes('10') || taskTypeList.includes('11'))
          "
        >
          <view class="info-list">
            <view v-for="item in form.rdInformationDTO" :key="item.id" class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">资料名称</view>
                <view class="info-list-value">{{ item.informationName }}</view>
              </view>
              <view class="info-list-row">
                <view class="info-list-label">资料描述</view>
                <view class="info-list-value">{{ item.informationDesc }}</view>
              </view>
              <view
                class="info-list-row"
                v-if="item.rdInformationProfileEntity && item.rdInformationProfileEntity.length"
              >
                <view class="info-list-label">附件</view>
                <view
                  class="info-list-value"
                  style="flex-direction: column; align-items: flex-start"
                >
                  <view
                    v-for="file in item.rdInformationProfileEntity"
                    :key="file.id"
                    @click="previewFileHandle(file.profileUrl)"
                    class="info-row-item"
                  >
                    {{ file.profileInfo }}
                  </view>
                </view>
              </view>
              <view class="info-list-row">
                <view class="info-list-label">网址</view>
                <view
                  class="info-list-value info-row-item"
                  @click="previewWeb(item.informationWeb)"
                >
                  {{ item.informationWeb }}
                </view>
              </view>
            </view>
          </view>
        </th-form-item>
        <th-form-item
          label="资料收集综述"
          class="form-demandDesc"
          v-if="
            form.sampleReviewConclusion &&
            (taskTypeList.includes('10') || taskTypeList.includes('11'))
          "
        >
          <text class="text">{{ form.sampleReviewConclusion }}</text>
        </th-form-item>
        <th-form-item
          label="合成工艺路线"
          style="flex-direction: column; align-items: start"
          v-if="
            form.rdCraftEntity &&
            form.rdCraftEntity.length &&
            (taskTypeList.includes('10') || taskTypeList.includes('11'))
          "
        >
          <view class="info-list">
            <view v-for="item in form.rdCraftEntity" :key="item.id" class="info-list-main">
              <view class="info-list-row">
                <view class="info-list-label">名称</view>
                <view class="info-list-value">{{ item.craftName }}</view>
                <view v-if="item.delFlag == 1">
                  <!-- <text style="color: red" bg-color="red">废弃</text> -->
                  <wd-tag plain bg-color="red" color="red">废弃</wd-tag>
                </view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">反应条件</view>
                <view class="info-list-value">{{ item.craftDesc }}</view>
              </view>

              <view class="info-list-row" v-if="item.craftUrl">
                <view class="info-list-label">路线</view>
                <view class="info-list-value">
                  <wd-img
                    :width="140"
                    :height="140"
                    :src="item.craftUrl"
                    mode="aspectFit"
                    :enable-preview="true"
                  />
                </view>
              </view>

              <view class="info-list-row">
                <view class="info-list-label">是否选择</view>
                <view class="info-list-value">
                  <wd-switch
                    disabled
                    v-model="item.isUse"
                    :active-value="1"
                    :inactive-value="0"
                    style="margin: 5rpx 0"
                    size="small"
                  ></wd-switch>
                </view>
              </view>
            </view>
          </view>
        </th-form-item>

        <th-form-item
          label="分析手段"
          v-if="
            (form.taskType == '10' || form.taskType == '11') &&
            form.rdSampleAnalysisQcEntity &&
            form.rdSampleAnalysisQcEntity.length
          "
        >
          <text class="text">
            <view style="display: flex; flex-wrap: wrap">
              <view
                v-for="item in form.rdSampleAnalysisQcEntity"
                :key="item.id"
                class="result-tag"
                style="margin-right: 10rpx; background-color: #4d80f0"
              >
                {{ item.analysisName }}
              </view>
            </view>
          </text>
        </th-form-item>
        <view
          style="overflow: auto"
          class="table-container"
          v-if="
            (form.taskType == '10' || form.taskType == '11') &&
            form.rdSampleAnalysisQcEntity &&
            form.rdSampleAnalysisQcEntity.length
          "
        >
          <table class="analysis-table">
            <tbody>
              <tr>
                <th style="width: 320rpx; min-width: 9.5rem">名称</th>
                <th style="width: 280rpx; min-width: 280rpx">说明</th>
              </tr>
              <tr
                align="center"
                v-for="(item, index) in form.rdSampleAnalysisQcEntity"
                :key="index"
              >
                <td>
                  <view>
                    {{ item.analysisName }}
                  </view>
                </td>
                <td>
                  <view>
                    {{ item.analysisDesc }}
                  </view>
                </td>
              </tr>
            </tbody>
          </table>
        </view>

        <th-form-item
          label="附件"
          style="flex-direction: column; align-items: start"
          v-if="
            form.rdTaskFileEntity &&
            form.rdTaskFileEntity.length &&
            (taskTypeList.includes('10') || taskTypeList.includes('11'))
          "
        >
          <view class="info-list">
            <view class="info-list-main">
              <view class="info-list-row">
                <!-- <view class="info-list-label">附件</view> -->
                <view class="info-list-value">
                  <view style="display: flex; flex-direction: column">
                    <view
                      v-for="file in form.rdTaskFileEntity"
                      :key="file.id"
                      @click="previewFileHandle(file.fileUrl)"
                      class="info-row-item"
                    >
                      {{ file.fileName }}
                    </view>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </th-form-item>
      </th-card>

      <!-- <th-card :title="form.projectName" v-if="form.taskType == 30">
        <directSampleForm ref="directSampleFormRef"></directSampleForm>
      </th-card> -->

      <template v-if="form.taskType == 30">
        <directSampleForm ref="directSampleFormRef"></directSampleForm>
      </template>

      <th-card :title="form.projectName" v-if="form.taskType == 9">
        <otherForm ref="otherFormRef"></otherForm>
      </th-card>

      <th-card :title="form.projectName" v-if="form.taskType == 4">
        <questionForm ref="questionFormRef"></questionForm>
      </th-card>

      <th-card
        :title="form.projectName"
        v-if="
          (form.taskType == 2 || form.taskType == 12) &&
          form.rdSampleAnalysisEntity &&
          form.rdSampleAnalysisEntity.length
        "
      >
        <th-form-item
          label="分析手段"
          v-if="form.rdSampleAnalysisEntity && form.rdSampleAnalysisEntity.length"
        >
          <text class="text">
            <view style="display: flex; flex-wrap: wrap">
              <view
                v-for="item in form.rdSampleAnalysisEntity"
                :key="item.id"
                class="result-tag"
                style="margin-right: 10rpx; background-color: #4d80f0"
              >
                {{ item.analysisName }}
              </view>
            </view>
          </text>
        </th-form-item>
        <view
          style="overflow: auto"
          class="table-container"
          v-if="form.rdSampleAnalysisEntity && form.rdSampleAnalysisEntity.length"
        >
          <table class="analysis-table">
            <tbody>
              <tr>
                <th style="width: 320rpx; min-width: 9.5rem">名称</th>
                <th style="width: 280rpx; min-width: 280rpx">说明</th>
              </tr>
              <tr align="center" v-for="(item, index) in form.rdSampleAnalysisEntity" :key="index">
                <td>
                  <view>
                    {{ item.analysisName }}
                  </view>
                </td>
                <td>
                  <view>
                    {{ item.analysisDesc }}
                  </view>
                </td>
              </tr>
            </tbody>
          </table>
        </view>
      </th-card>
      <template v-if="form.taskType == 2 || form.taskType == 12">
        <!-- <th-card title="外来样报检报告"> -->
        <assayReport :pid="form.id" :version="1"></assayReport>
        <!-- </th-card> -->
        <th-card title="附件" v-if="form.rdTaskFileEntity && form.rdTaskFileEntity.length">
          <view class="info-list">
            <view class="info-list-main">
              <view class="info-list-row">
                <!-- <view class="info-list-label">附件</view> -->
                <view class="info-list-value">
                  <view style="display: flex; flex-direction: column">
                    <view
                      v-for="file in form.rdTaskFileEntity"
                      :key="file.id"
                      @click="previewFileHandle(file.fileUrl)"
                      class="info-row-item"
                    >
                      {{ file.fileName }}
                    </view>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </th-card>
      </template>

      <!-- <th-card :title="form.projectName" v-if="form.taskType == 3">
        <information ref="informationRef"></information>
      </th-card> -->

      <th-card :title="form.projectName" v-if="form.taskType == 13">
        <extendenWarrantyPeriodForm
          ref="extendenWarrantyPeriodFormRef"
        ></extendenWarrantyPeriodForm>
      </th-card>

      <template v-if="form.taskType == 3">
        <information ref="informationRef"></information>
      </template>
      <template v-if="form.taskType == 6">
        <fupeiForm ref="fupeiFormRef"></fupeiForm>
      </template>
      <template v-if="form.taskType == 7">
        <attenuationForm ref="attenuationFormRef"></attenuationForm>
      </template>

      <th-card
        title="审核信息"
        v-if="form.status == '1' || form.status == '2' || form.status == '3'"
      >
        <view class="row-list">
          <view class="row" v-if="form.id && form.taskId">
            <!-- <view class="label">审核意见</view> -->
            <view class="value">
              <view class="mb2 mt2">
                <h5>审核意见</h5>
              </view>
              <wd-textarea
                type="textarea"
                v-model="comment"
                rows="6"
                placeholder="请输入审核意见"
                style="border: 1px solid #f7f7f7"
              ></wd-textarea>
            </view>
          </view>
          <view>
            <!-- <view class="mb2 mt2">
                <h5>流转详情</h5>
              </view> -->
            <!-- <flowDetailsTable
              ref="flowDetailsTableRef"
              :processInstanceId="form.instanceId"
            ></flowDetailsTable> -->
            <flowTable ref="flowDetailsTableRef" :processInstanceId="form.instanceId"></flowTable>
          </view>
        </view>
      </th-card>
    </view>

    <view class="flow-btn-fixed" v-if="form.taskAllStatus == '1'">
      <view class="btn_group" style="width: 100%">
        <view class="btn danger" @click="oncomplete(1)" v-if="form.id && form.taskId">
          <image src="../../../static/reject.png" class="btn-icon"></image>
          拒绝
        </view>
        <view class="btn primary" @click="oncomplete(0)" v-if="form.id && form.taskId">
          <image src="../../../static/tongyi.png" class="btn-icon"></image>
          同意
        </view>
        <view
          class="btn primary"
          @click="onRevokeShow()"
          v-if="!(form.taskId || !(form.id && form.status == 1))"
        >
          <image src="../../../static/rovoke.png" class="btn-icon"></image>
          撤回
        </view>
        <view
          class="btn primary"
          @click="onCancelApprover()"
          v-if="
            (form.status == '2' || form.status == '3') &&
            isCanCancelApprover &&
            form.taskAllStatus == '1'
          "
        >
          <image src="../../../static/rovoke1.png" class="btn-icon"></image>
          弃审
        </view>
      </view>
    </view>
    <wd-popup v-model="revokeShow" position="bottom" @close="handleClose">
      <view style="display: flex; flex-direction: column; height: 100%">
        <wd-textarea
          v-model="revokeComment"
          placeholder="请填写撤回原因"
          no-border
          prop="revokeComment"
          class="reovke-textarea"
        />
        <view class="flow-btn-fixed">
          <view class="btn_group" style="width: 100%">
            <view class="btn danger" @click="handleClose">取消</view>
            <view class="btn primary" @click="onRevoke">撤回</view>
          </view>
        </view>
      </view>
    </wd-popup>
  </view>
</template>

<script lang="ts" setup>
import { useSetting } from '@/stores/setting';
import { getObj, completeTask, revokeProcess, reviveProcess } from '@/service/pm-task';
import {
  listLastNodePerson,
  selectTaskByProcessInstanceId,
  selectrdDocumentsPostDict,
} from '@/service/pm-requirement';
import { formatByDayjs } from '@/utils/util';
import { useUserStore } from '@/stores/user';
import showModal from '@/utils/modal';
import information from './component/information.vue';
import sampleAnalysisze from './component/sample-analysize.vue';
import questionForm from './component/question.vue';
import otherForm from './component/other.vue';
import attenuationForm from './component/attenuation.vue';
// import assayReport from '@/pages/pm/assay-report/component/assayReport.vue';
import assayReport from './component/assayReport.vue';
import directSampleForm from './component/direct-sample.vue';
import fupeiForm from './component/fupei.vue';
import extendenWarrantyPeriodForm from './component/extenden-warranty-period-form.vue';

const setting = useSetting();
const userStore = useUserStore();
const showSign = ref(false);
const signature = ref('');
const userInfo = ref({});
const isChiefEngineer = ref('');
const isDeputyChiefEngineer = ref('');
const showAction = ref(false);
const flowDetailsTableRef: any = ref({});
const rdProjectUserList = ref([]); // 签名列表
const directSampleFormRef: any = ref({});
const otherFormRef: any = ref({});
const questionFormRef: any = ref({});
const informationRef: any = ref({});
const fupeiFormRef: any = ref({});
const attenuationFormRef: any = ref({});
const showMoreDemand = ref(false);
const checkTargetList = ref([]);
const extendenWarrantyPeriodFormRef: any = ref({});

// 提交表单数据
const form = reactive({
  id: null,
  demandDate: null,
  personName: null,
  demandType: null,
  deptHead: null,
  deptCode: null,
  applicationType: null,
  samplesNum: null,
  demandDesc: null,
  sampleCoding: null,
  askCompleteTime: null,
  taskCode: null,
  userCode: null,
  invName: null,
  invDemand: null,
  sampleFlag: null,
  demandCode: null,
  demandTypeCode: null,
  cusName: null,
  personCode: null,
  deptHeadCode: null,
  cusFlag: '0',
  demandResult: null,
  completeTime: null,
  technologyHead: null,
  remark: null,
  technologyHeadCode: null,
  taskId: null,
  instanceId: null,
  invStd: null,
  sampleCode: null,
  sampleBatch: null,
  deptName: null,
  rdFlag: null,
  chiefEngineer: null,
  deputyChiefEngineer: null,
  status: null,
  sampleFlagName: null,
  deputyChiefEngineerUrl: null,
  chiefEngineerUrl: null,
  sampleUnit: null,
  cusCode: null,
  projectCode: null,
  projectName: null,
  rdProjectUser: null,
  projectHead: null,
  userTime: null,
  technologyHeadName: null,
  rdInformationDTO: [],
  rdCraftEntity: [],
  rdSampleAnalysisEntity: [],
  rdPlan: null,
  sampleReviewConclusion: null,
  requirements: null,
  projectHeadName: null,
  signedName: null,
  taskAllStatus: '1',
  rdTaskListAll: [],
  rdTaskFileEntity: [],
  others: null,
  rdProjectUserEntity: [],
  taskType: null,
  requestFlag: '0',
  requestNum: '',
  requestNumUnit: '',
  rdDemandFileEntity: [],
  recommendFlag: null,
  recommendInvName: null,
  recommendInvStd: null,
  rdSampleAnalysisQcEntity: [],
});

const init = (params) => {
  uni.showLoading();
  selectrdDocumentsPostDictList();
  getObj(params)
    .then((res) => {
      form.instanceId = '';
      console.log('res', res);
      Object.assign(form, res.data);
      const { rdDemandEntity } = res.data;
      if (rdDemandEntity) {
        const o: any = {};
        o.demandDate = rdDemandEntity.demandDate ? formatByDayjs(rdDemandEntity.demandDate) : '';
        o.askCompleteTime = rdDemandEntity.askCompleteTime
          ? formatByDayjs(rdDemandEntity.askCompleteTime)
          : '';
        o.demandCode = rdDemandEntity.demandCode;
        o.cusCode = rdDemandEntity.cusCode;
        o.deptName = rdDemandEntity.deptName;
        o.demandType = rdDemandEntity.demandType;
        o.deptCode = rdDemandEntity.deptCode;
        o.invName = rdDemandEntity.invName;
        o.invStd = rdDemandEntity.invStd;
        o.applicationType = rdDemandEntity.applicationType;
        o.invDemand = rdDemandEntity.invDemand;
        o.sampleFlagName = rdDemandEntity.sampleFlagName;
        o.sampleCode = rdDemandEntity.sampleCode;
        o.samplesNum = rdDemandEntity.samplesNum;
        o.sampleUnit = rdDemandEntity.sampleUnit;
        o.sampleBatch = rdDemandEntity.sampleBatch;
        // o.askCompleteTime = rdDemandEntity.askCompleteTime;
        o.demandDesc = rdDemandEntity.demandDesc;
        o.cusFlag = rdDemandEntity.cusFlag;
        o.sampleFlag = rdDemandEntity.sampleFlag;
        o.personName = rdDemandEntity.personName;
        // o.cusName = rdDemandEntity.cusName;

        o.requestFlag = rdDemandEntity.requestFlag;
        o.requestNum = rdDemandEntity.requestNum;
        o.requestNumUnit = rdDemandEntity.requestNumUnit;
        o.demandResult = rdDemandEntity.demandResult;
        o.tenantName = rdDemandEntity.tenantName;
        o.demandTypeCode = rdDemandEntity.demandTypeCode;
        o.reviewConclusiondemand = rdDemandEntity.reviewConclusion;
        checkTargetList.value = res.data.rdDemandStandardEntity
          .filter((item) => item.delFlag != 1)
          .map((item) => {
            return {
              ...item,
              standardName: item.standardName,
              standardCode: item.standardCode,
              standardValue: item.standardValue,
              standardValuePm: item.standardValuePm,
            };
          });

        Object.assign(form, o);
      }

      // analysisList.value = res.data.rdSampleAnalysisEntity;
      // const rdProject = [];
      const rdProject = [];
      res.data.rdProjectUserEntity.forEach((item: any) => {
        rdProject.push(item.userName);
      });
      form.rdProjectUser = rdProject.join(',');

      let rdInformationDTO =
        res.data.rdInformationDTO && res.data.rdInformationDTO.length
          ? res.data.rdInformationDTO
          : [];
      rdInformationDTO = rdInformationDTO.map((item) => {
        const l = item.rdInformationProfileEntity;
        const rdInformationProfileEntity = [];
        l.forEach((rd) => {
          const { profileType } = rd;
          if (profileType == 'web') {
            item.informationWeb = rd.profileUrl;
          } else {
            rdInformationProfileEntity.push(rd);
          }
        });

        return {
          ...item,
          rdInformationProfileEntity,
        };
      });

      form.rdInformationDTO = rdInformationDTO;
      // getCancelApprover();
      if (res.data.instanceId) {
        selectTaskByProcessInstanceId({
          processInstanceId: res.data.instanceId,
        })
          .then((res) => {
            form.taskId = res.data && res.data.taskId ? res.data.taskId : null;
          })
          .catch(() => {
            form.taskId = null;
          });
        getCancelApprover();
        console.log('form', form);
      }
      nextTick(() => {
        try {
          flowDetailsTableRef.value && flowDetailsTableRef.value.getFlowDetails();
        } catch (error) {
          console.log('flowDetailsTableRef error ', error);
        }
      });

      const v = String(res.data.taskType);
      taskTypeList.value = [v];

      form.rdTaskListAll =
        form.rdTaskListAll && form.rdTaskListAll.length ? form.rdTaskListAll : [];
      form.rdTaskListAll = form.rdTaskListAll.map((item) => {
        return {
          ...item,
          title: `${item.taskCode} - ${item.projectName}`,
        };
      });

      if (form.taskType == '30') {
        nextTick(() => {
          directSampleFormRef.value.init(res.data);
        });
      } else if (form.taskType == '9') {
        nextTick(() => {
          otherFormRef.value.init(res.data);
        });
      } else if (form.taskType == '4') {
        nextTick(() => {
          questionFormRef.value.init(res.data);
        });
      } else if (form.taskType == '3') {
        nextTick(() => {
          informationRef.value.init(res.data);
        });
      } else if (form.taskType == '6') {
        nextTick(() => {
          fupeiFormRef.value.init(res.data);
        });
      } else if (form.taskType == '7') {
        nextTick(() => {
          attenuationFormRef.value.init(res.data);
        });
      } else if (form.taskType == '13') {
        nextTick(() => {
          extendenWarrantyPeriodFormRef.value.init(res.data);
        });
      }
    })
    .finally(() => {
      uni.stopPullDownRefresh();
      uni.hideLoading();
    });
};

onLoad((options) => {
  const { id } = options;
  init({
    id,
  });
});

const getRdFlat = (flag) => {
  if (flag == '1') {
    return '通过';
  }
  if (flag == '0') {
    return '不通过';
  }
};

onPullDownRefresh(() => {
  init({
    id: form.id,
  });
});

const goBack = () => {
  uni.navigateBack();
};

const preview = (url) => {
  if (!url) return;
  uni.previewImage({
    urls: [url],
  });
};

const previewImg = (url) => {
  if (!url) return;
  const urls = [];
  urls.push(url);
  console.log('url', urls);
  uni.previewImage({
    urls,
    fail: (fail) => {
      console.log('fail', fail);
    },
  });
};

const previewFileHandle = (file) => {
  uni.navigateTo({
    url: `/pages/pm/preview-online?url=${file}`,
  });
};

const previewWeb = (url) => {
  uni.navigateTo({
    url: `/pages/pm/preview-online?url=${url}&isWeb=1`,
  });
};

// 审核信息
const comment = ref('');
const oncomplete = (type) => {
  if (type == '1' && !comment.value) {
    uni.showToast({
      title: '请填写审核意见',
      icon: 'none',
      mask: true,
    });
    return;
  }

  const params = {
    // ...form,
    taskId: form.taskId,
    comment: comment.value,
    id: form.id,
    approve: type == 0,
  };
  uni.showLoading({
    mask: true,
  });
  completeTask(params, form.id)
    .then((res) => {
      if (res.code == 0) {
        uni.showToast({
          title: '单据审核成功',
          icon: 'none',
          mask: true,
        });
        // uni.navigateBack({});
        form.instanceId = '';
        init({
          id: form.id,
        });
        uni.$emit('refresh');
        // nextTick(() => {
        //   flowDetailsTableRef.value.getFlowDetails();
        // });
      } else {
        uni.showToast({
          mask: true,
          title: `单据审核失败，失败原因：${res.msg}`,
          icon: 'none',
        });
      }
    })
    .finally(() => {
      uni.hideLoading();
    });
};

// 撤回
const revokeComment = ref('');
const revokeShow = ref(false);

const onRevokeShow = () => {
  revokeShow.value = true;
};
const handleClose = () => {
  revokeShow.value = false;
};
const onRevoke = () => {
  showModal({
    title: '提示',
    content: '是否撤回该单据',
    showCancel: true,
    confirm: () => {
      uni.showLoading({
        mask: true,
      });
      revokeProcess({
        id: form.id,
        instanceId: form.instanceId,
        comment: revokeComment.value,
      })
        .then((res) => {
          if (res.code == 0) {
            uni.showToast({
              mask: true,
              title: `单据${form.demandCode}撤回成功`,
              icon: 'none',
            });
            handleClose();
            init({ id: form.id });
          } else {
            uni.showToast({
              mask: true,
              title: `单据${form.demandCode}撤回失败，失败原因：${res.msg}`,
              icon: 'none',
            });
          }
        })
        .finally(() => {
          uni.hideLoading();
        });
    },
  });
};

const isCanCancelApprover = ref(false); // 是否能弃审
const getCancelApprover = () => {
  listLastNodePerson({
    processInstanceId: form.instanceId,
  })
    .then((res) => {
      const dataList = res.data;
      const { username } = userStore.userInfos.user;
      if (dataList.find((item) => item == username)) {
        isCanCancelApprover.value = true;
      } else {
        isCanCancelApprover.value = false;
      }
    })
    .finally(() => {});
};

const onCancelApprover = () => {
  showModal({
    title: '提示',
    content: '是否弃审该单据',
    showCancel: true,
    confirm: () => {
      uni.showLoading({
        mask: true,
      });
      reviveProcess(form.id)
        .then((res) => {
          if (res.code == 0) {
            uni.showToast({
              mask: true,
              title: `单据${form.demandCode}弃审成功`,
              icon: 'none',
            });
            form.instanceId = '';
            init({ id: form.id });
            // nextTick(() => {
            //   flowDetailsTableRef.value.getFlowDetails();
            // });
          } else {
            uni.showToast({
              mask: true,
              title: `单据${form.demandCode}弃审失败，失败原因：${res.msg}`,
              icon: 'none',
            });
          }
        })
        .finally(() => {
          uni.hideLoading();
        });
    },
  });
};

const taskTypeList = ref([]);
const rdTaskListAllActiveKey = ref([]);

const tableRefs = ref({});
const setItemRef = (e, item) => {
  tableRefs.value[item] = e;
};

const beforeExpend = (e) => {
  return new Promise((reslove, reject) => {
    const o = form.rdTaskListAll.find((item) => item.id == e);
    try {
      uni.showLoading();
      getObj({ id: e })
        .then((res) => {
          console.log('1344', res);
          if (res.code != 0) {
            uni.showToast({
              mask: true,
              title: `获取数据失败, 失败原因: ${res.msg}`,
              icon: 'none',
            });
            uni.hideLoading();
            return;
          }
          nextTick(() => {
            tableRefs.value[o.taskCode].init(res.data);
            setTimeout(() => {
              uni.hideLoading();
              reslove(true);
            }, 1000);
          });
        })
        .catch((err) => {
          uni.hideLoading();
          console.log('nefore', err);
        });
    } catch (error) {
      console.log('err', error);
      reject(false);
    }
  });
};

const selectrdDocumentsPostDictList = async () => {
  try {
    const res = await selectrdDocumentsPostDict({
      webSql: `documents_code = '2'`,
      size: 1000,
    });
    if (res.code !== 0) {
      return;
    }
    rdProjectUserList.value = res.data.records;
  } catch (err) {
    console.log('err', err);
  }
};

// type 0 获取姓名 1 获取签名
const getProjectName = (item, type = 0) => {
  console.log(form.rdProjectUserEntity, item);
  const l = form.rdProjectUserEntity.filter((f) => f.userType == item.documentsPostCode);
  let s = '';
  if (l.length) {
    console.log('s', s);
    if (type == 0) {
      s = l.map((item) => item.userName).join(',');
      return s;
    }
    // s = l.map((item) => item.userUrl).join(',');
    s = l[0].userUrl;
    return s;
  }
  return s;
};

const showMoreDemandhandle = () => {
  showMoreDemand.value = !showMoreDemand.value;
};
</script>

<style lang="scss" scoped>
@import '../experiment/components/table';

.block .content {
  padding: 0 !important;
}

.card-detail {
  padding: 0 !important;
}

.wd-cell {
  padding-left: 0 !important;
}

.wd-card__title {
  border-left: 4px solid #2e5cf6 !important;
}

.pm-table {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0 30rpx;

  .pm-title {
    box-sizing: border-box;
    padding-left: 20rpx;
    margin: 40rpx 0;
    font-size: 32rpx;
    font-weight: bold;
    color: #333;
    border-left: 8rpx solid #2e5cf6;
    border-radius: 4rpx;
  }

  .pm-row {
    display: flex;
    min-height: 60rpx;
    border-bottom: 1px solid #f6f0f0;

    .pm-label {
      display: flex;
      align-items: center;
      width: 20%;
      font-size: 26rpx;
      color: #979494;
    }

    .pm-value {
      display: flex;
      flex: 1;
      align-items: center;
      font-size: 26rpx;
      color: #333;
    }
  }
}

.sign-main {
  // display: flex;
  // align-items: center;
  // justify-content: center;
  // width: 100%;
  // margin: 20rpx 0;
  position: fixed;
  right: 0rpx;
  bottom: 40rpx;
  width: 160rpx;
  height: 80rpx;
  line-height: 80rpx;
  color: white;
  text-align: center;
  background-color: rgb(77 128 240);

  // border-radius: 50%;
  border-top-left-radius: 40rpx;
  border-bottom-left-radius: 40rpx;
}

:deep(.label) {
  width: 160rpx !important;
}

.result-tag {
  padding: 6rpx 14rpx;
  margin: 2rpx 0;
  font-size: 24rpx;
  color: white;
  background-color: #87d068;
  border-radius: 4rpx;
}

.sign-main-show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .sign-main-show-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80rpx;
    margin-bottom: 20rpx;
    font-size: 30rpx;
    font-weight: bold;
    color: #818181;
    border-bottom: 1px solid #e3e3e3;
  }

  .sign-main-show-line {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    padding: 20rpx;
    margin: 20rpx 0;
    border: 4rpx solid #d0dbff;
    border-radius: 10rpx;
  }

  .sign-main-show-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80rpx;
    border-top: 1px solid #e3e3e3;
  }
}

.info-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.info-list-main {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10rpx;
  margin: 10rpx 0;
  border: 1px solid #e3e3e3;
  border-radius: 8rpx;

  .info-list-row {
    display: flex;
    width: 100%;

    .info-list-label {
      width: 150rpx;
      font-size: 28rpx;
      color: #808080;
    }

    .info-list-value {
      display: flex;
      flex: 1;
      align-items: center;
      width: 0;
    }
  }
}

.craft-row {
  display: flex;
  align-items: center;

  .craft-row-img-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 0;
  }
}

.craft-row-img {
  width: 80rpx;
  height: 80rpx;
}

.form-demandDesc {
  align-items: flex-start !important;
}

.info-row-item {
  // padding: 6rpx 0;
  // word-break: break-all;

  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 6rpx 0;
  color: blue;
  word-break: break-all;

  // border-bottom: 1px solid #f2f2f2;
}

.text {
  word-break: break-all;
  word-wrap: break-word;
}

.flow-btn-fixed {
  width: 100%;
  background-color: white;
  border-top: 1px solid #f2f2f1;
}

.btn_group {
  display: flex;
  justify-content: space-between;

  // margin: 0rpx 0 20rpx;
  // border-bottom: 1px solid #f2f2f1;

  .btn {
    display: flex;

    // width: 49%;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    // height: 40px;
    min-height: 40px;
    padding: 10rpx 0;
    font-size: 24rpx;
    color: black;

    // background-color: white !important;
    background-color: #dbecff !important;
    border-left: 1px solid #f7f7f7;
    border-radius: 0 !important;

    // color: white;
    border-radius: 6rpx;

    .btn-icon {
      width: 40rpx;
      height: 40rpx;
      margin-bottom: 8rpx;
    }
  }

  .danger {
    background-color: #f56c6c;
  }

  .primary {
    background-color: #409eff;
  }
}

:deep(.wd-collapse-item__body) {
  padding: 10rpx;
}

:deep(.wd-collapse-item__header) {
  padding-right: 10rpx;
  padding-left: 10rpx;
}

.exportModel {
  width: 100%;
  margin-top: 10rpx;
  font-size: 28rpx;
  color: #409eff;
  text-align: center;
}

:deep(.collapse-auto-class .wd-collapse-item__wrapper) {
  height: auto !important;
}
</style>
